export * from './options'


export class Container {
    constructor(id,width='100%',height='100%',colNum=3,rowNum=null) {
        this.id = id;
        this.width = width
        this.height = height
        this.colNum = colNum
        this.rowNum = rowNum
    }
}

export const createContainer = (chessBoard) => {
    const {id,width,height,colNum,rowNum} = chessBoard
    width ??= '100%'
    height ??= '100%',
    colNum ??= 3

    return new Container(id,width,height,colNum,rowNum)
}

export class Project {
  constructor(id,colStart,colEnd,rowStart,rowEnd,width,height) {
        this.id = id
        this.colStart = colStart
        this.colEnd = colEnd
        this.rowStart = rowStart
        this.rowEnd = rowEnd
        this.width = width
        this.height = height
    }
}

export class ChessPieceSet{
    constructor(id,colStart,colEnd,rowStart,rowEnd,width,height) {
        this.id = id
        this.colStart = colStart
        this.colEnd = colEnd
        this.rowStart = rowStart
        this.rowEnd = rowEnd
        this.width = width
        this.height = height
    }
}

export const createPiece = (chessPiece) => {
    const {id,value,label,filterOptions,type} = chessPiece
    return {
        id,
        value,
        label,
        filterOptions,
        type,
    }
}

export const createChessPieceSet = (chessPieceSet) => {
    const {id,colStart,colEnd,rowStart,rowEnd,width,height,chessPieceDto} = chessPieceSet

    const chessPiece = createPiece(chessPieceDto)
    return {
        id,
        colStart,
        colEnd,
        rowStart,
        rowEnd,
        width,
        height,
        chessPiece,
    }

}

export const templateMap =  {
    1: 'diagnoses',
    2: 'pmh'
}